package net.fonline.apps.pathfinder;

import java.util.Random;
import net.fonline.apps.LineTowerWars;

/**
 * A waypoint of the maze
 * It has coordinates for path calculation.
 * @author Scaatis
 */
public class Square {

    public boolean passable;
    public boolean path = false;
    public double cost = 1.0;
    public int x;
    public int y;

    public Square(int x, int y) {
        this.x = x;
        this.y = y;
        // Passable weil Startpunkt
        passable = !LineTowerWars.ec.map.entities[x][y].active;
    }

    public boolean isDiagonallyAdjacentTo(Square s) {
        if ((x == s.x + 1 || x == s.x - 1) && (y == s.y + 1 || y == s.y - 1)) {
            return true;
        } else {
            return false;
        }
    }
}
